_T.Ui.GridPanel = {};

_T.Ui.GridPanel.Column = function (el, index) {
	
    var _this = this;

    this.el = el;

    this.index = index;

    this.get = function (name) {
        return this.el.getAttribute(name);
    };
 
};

_T.Ui.WIDGET = _T.Ui.Widget = _T.Ui.GridPanel.Widget = function (el) {

    var _this = this;

    this.el = el;

    this.get = function (name) {
        return this.el.getAttribute(name);
    };

    
    this.init = function () {
    	 this.create();
    };

    this.initModel = function () {
      
    };

    this.create = function () {
    	var id = _this.get('tid');
    	
    	var widget = $('<div class="widget"/>');
    	widget .appendTo($(_this.el).parent());
    	
    	var  widget_head= $('<div class="widget-head"/>');
    	widget_head.appendTo(widget);
    	
    	var widget_title = $('<div class="pull-left">图表</div>');
    	widget_title.appendTo(widget_head);
    	
    	var widget_icon = $('<div class="widget-icons pull-right"/>');
    	widget_icon.appendTo(widget_head);
    	
    	var wminimize = $('<a href="#" class="wminimize"><i class="icon-chevron-up"></i></a>');
    	var wclose = $('<a href="#" class="wclose"><i class="icon-remove"></i></a>');
    	wminimize.appendTo(widget_icon);
    	wclose.appendTo(widget_icon);
    	
    	 var clearfix = $(' <div class="clearfix"></div>');
    	 clearfix.appendTo(widget_head);
    	 
    	 var widget_content = $('<div class="widget-content">');
    	 widget_content.appendTo(widget);
    };

    this.load = function (params) {
        
    };
    
    //////////////////////////////////////////////////////////////////////////////////////
    //注册事件
    this.initEvent = function () {
    	 
    };
    
    this.init();
};
